<template>
  <div>
    <p>当前count值：{{ bb }}</p>
    <button @click="sub">-1</button>
  </div>
</template>

<script>
import { mapState } from "vuex"
export default {
  data() {
    return {}
  },
  methods: {
    sub() {
      this.$store.state.count--
      this.$store.dispatch('addSync')
    }
  },
  computed: {
    ...mapState(["bb"])
  }
}
</script>

<style>
</style>